namespace AgentJohnson.CodeAnnotations
{
  using AgentJohnson.CodeAnnotations.Handlers;
  using Resharper.Abstractions.CodeAnnotations;
  using Resharper.Abstractions.Daemons;

  /// <summary>Defines the <see cref="ClassAnnotationsDaemon"/> class.</summary>
  [DaemonStage(StagesBefore = new[]
  {
    typeof(CodeAnnotationDaemon)
  })]
  public class ClassAnnotationsDaemon : ClassAnnotationDaemonBase
  {
    #region Methods

    /// <summary>Handles the attribute.</summary>
    /// <param name="attributeName">The name.</param>
    protected override ClassAnnotationHandler HandleAttribute(string attributeName)
    {
      if (attributeName.EndsWith("NoPublicSettersAttribute"))
      {
        return new NoPublicSetters();
      }

      if (attributeName.EndsWith("PublicMethodsMustBeVirtualAttribute"))
      {
        return new PublicMethodsMustBeVirtual();
      }

      return null;
    }

    #endregion
  }
}